<section id="cart_items">
	<div class="container">
		<div class="breadcrumbs">
			<ol class="breadcrumb clear-mgr">
				<li><a href="<?php echo page_url(); ?>"><i class="fa fa-home"></i> Trang chủ</a></li>
				<li class="active">Thanh toán</li>
			</ol>
		</div>

		<div class="review-payment">
			<h2>Xem lại đơn đặt hàng</h2>
		</div>

		<div class="table-responsive cart_info">
			<table class="table table-condensed" action-result="<?php echo page_url('cart/total-result');?>" action-remove="<?php echo page_url('cart/delete-item'); ?>" action-update="<?php echo page_url('cart/update-item'); ?>">
				<thead>
					<tr class="cart_menu">
						<td class="table-title image">Sản phẩm</td>
						<td class="table-title description"></td>
						<td class="table-title price">Đơn giá</td>
						<td class="table-title quantity">Số lượng</td>
						<td class="table-title total">Thành tiền</td>
						<td>&nbsp;</td>
					</tr>
				</thead>
				<tbody>
					<?php foreach($cart as $index=>$item){ ?>
					<tr>
						<td class="cart_product">
							<a href="<?php echo product_url($item['options']['slug']); ?>">
								<img width="96px" src="<?php echo product_upload($item['options']['image'], $item['options']['shop_image_folder']); ?>" alt=""/>
							</a>
						</td>
						<td class="cart_description">
							<h4><a class="item-title f16px clear-mgr clear-pad" href="<?php echo product_url($item['options']['slug'], $item['options']['code']); ?>"><?php echo $item['name']; ?></a></h4>
							<p class="mgt5">Mã sp: <?php echo $item['options']['code']; ?></p>
							<p>
								<a href="<?php echo shop_url($item['options']['shop_slug']); ?>"><?php echo $item['options']['shop_title']; ?></a>
							</p>
						</td>
						<td class="cart_price">
							<p><?php echo currency_format($item['price']); ?></p>
						</td>
						<td class="cart_quantity col-cart-qty">
							<div class="cart_quantity_button" data-submit="#btn-<?php echo $index; ?>" data-follow="#cart-<?php echo $index; ?>">
								<a class="cart_quantity_control cart_quantity_down" href="" data-value="-1"> - </a>
								<input id="cart-<?php echo $index; ?>" class="cart_quantity_input item-quantity" type="text" name="quantity" value="<?php echo $item['qty']; ?>" autocomplete="off" size="2"/>
								<a class="cart_quantity_control cart_quantity_up" href="" data-value="+1"> + </a>
								<button id="btn-<?php echo $index; ?>" class="btn-update-cart-item hidden" item="<?php echo $item['rowid']; ?>">Update</button>
							</div>
						</td>
						<td class="cart_total col-cart-subtotal">
							<span class="cart_total_price"><?php echo currency_format($item['subtotal']); ?></span>
						</td>
						<td class="cart_delete">
							<a item="<?php echo $item['rowid']; ?>" class="cart_quantity_delete btn-remove-cart-item" href=""><i class="fa fa-times"></i></a>
						</td>
					</tr>
					<?php } ?>
					<tr>
						<td colspan="4">&nbsp;</td>
						<td colspan="2">
							<table class="table table-condensed total-result">
								<tbody>
									<tr>
										<td>Tổng số sản phẩm</td>
										<td><span class="cart-total-item"><?php echo $this->cart->total_items(); ?></span></td>
									</tr>
									<tr>
										<td>Tổng giá trị</td>
										<td><span id="total-price"><?php echo currency_format($this->cart->total()); ?></span></td>
									</tr>
								</tbody>
							</table>
						</td>
					</tr>
					<tr>
						<td colspan="6">
							<?php $shopping_url = $this->input->get('ref', true)!=false?$this->input->get('ref', true):base_url(); ?>
							<a class="btn btn-primary" href="<?php echo $shopping_url; ?>">
								<i class="fa fa-shopping-cart"></i>&nbsp; Tiếp tục mua sắm
							</a>
						</td>
					</tr>
				</tbody>
			</table>
		</div>

		<div id="thanh-toan" class="shopper-informations">
			<div class="row">
				<div class="col-md-8 col-sm-9">
					<div id="flg_message" class="alert alert-dismissable hidden">
						<h4 class="message-title"></h4>
						<div class="message-text text-hyphens"></div>
						<p class=""><a href="<?php echo page_url(); ?>"><i class="fa fa-home"></i> Về trang chủ</a></p>
					</div>
				</div>
				<div class="clearfix"></div>
				<form id="frm-cart" method="post" action="<?php echo page_url('cart/billing'); ?>">
					<div class="col-sm-4">
						<div class="bill-to">
							<p>Thông tin người đặt hàng</p>
							<div class="form-one">
								<label for="order_name">Họ tên *</label>
								<input type="text" maxlength="30" placeholder="Họ tên *" id="order_name" name="order[name]" value="<?php echo $obj_user->full_name; ?>" />
								<label for="order_email">Email *</label>
								<input type="text" maxlength="150" placeholder="Email*" id="order_email" name="order[email]" value="<?php echo $obj_user->email; ?>"/>
								<label for="order_phone">Số điện thoại *</label>
								<input type="text" maxlength="12" placeholder="Số điện thoại *" id="order_phone" name="order[phone]" value="<?php echo $obj_user->phone; ?>"/>
								<label for="order_address">Địa chỉ *</label>
								<textarea rows="4" maxlength="1000" placeholder="Địa chỉ *" id="order_address" name="order[address]"><?php echo $obj_user->address; ?></textarea>
								<div class="checkbox">
									<label class="mgt5" for="order-info-same">
										<input type="checkbox" name="order[order_info_same]" class="w-auto" id="order-info-same" value="1"/>
										Thông tin người nhận khác thông tin đặt hàng
									</label>
								</div>
							</div>
						</div>
					</div>
					<div class="col-sm-4">
						<div class="bill-to">
							<p>Thông tin người nhận hàng</p>
							<div class="form-one" id="form-receiver">
								<label for="receiver_name">Họ tên *</label>
								<input type="text" maxlength="30" placeholder="Họ tên *" id="receiver_name" name="order[receiver_name]" disabled="disabled" value="<?php echo $obj_user->full_name; ?>" />
								<label for="receiver_email">Email *</label>
								<input type="text" maxlength="150" placeholder="Email*" id="receiver_email" name="order[receiver_email]" disabled="disabled" name="order[email]" value="<?php echo $obj_user->email; ?>" />
								<label for="receiver_phone">Số điện thoại *</label>
								<input type="text" maxlength="12" placeholder="Số điện thoại *" id="receiver_phone" name="order[receiver_phone]" disabled="disabled" value="<?php echo $obj_user->phone; ?>" />
								<label for="receiver_address">Địa chỉ *</label>
								<textarea rows="4" maxlength="1000" placeholder="Địa chỉ *" id="receiver_address" name="order[receiver_address]" disabled="disabled"><?php echo $obj_user->address; ?></textarea>
							</div>
						</div>
					</div>
					<div class="col-sm-4">
						<div class="order-message">
							<p>Ghi chú</p>
							<textarea id="order-note" name="order[note]" placeholder="Các thông tin cần lưu ý trong hoá đơn" rows="16"></textarea>
						</div>
					</div>
					<div class="col-sm-12">
						<input type="hidden" id='order-user' name="order[user]" value="<?php echo $this->encrypt->encode($obj_user->id); ?>"/>
						<button type="button" class="btn btn-primary" id="btn-cart-submit" title="Thông tin đặt hàng chính xác, chúng tôi sẽ giao hàng sớm nhất đến bạn">
							&nbsp;<br />
							<i class="fa fa-check-square-o"></i>&nbsp; <span class='text-upper'>Xác nhận &amp; thanh toán</span>
							<br /> &nbsp;
						</button>
					</div>
					<div class="clearfix"></div>
				</form>
			</div>
		</div>
	</div>
</section>